<!DOCTYPE html>
<html>
<head>
    <title>基础数据登记</title>
<#include "../common/common.ftl"/>
    <link rel="stylesheet" href="/style/contractForm.css" media="all">
    <style>
        /*.laydate-time-list{padding-bottom:0;overflow:hidden}*/
        .laydate-time-list > li {
            width: 50% !important;
        }

        .laydate-time-list > li:last-child {
            display: none;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <form class="layui-form">
        <input type="hidden" name="zsProjectId" value="${(zsProject.id)!}"/>
        <div class="layui-card">
            <div class="layui-card-header">征收项目登记</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">县市：</label>
                    <div class="layui-input-blockRight">
                        <select id="townSelect" name="town" class="layui-input">
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">项目编号：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" lay-verify="projectCode|required"
                               placeholder="必填项" name="projectCode" value="${(zsProject.projectCode)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">项目名称：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="projectName" value="${(zsProject.projectName)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">公示时是否隐藏：</label>
                    <div class="layui-input-blockRight">
                        <select id="hideStatusSelect" name="hideStatus" class="layui-input">
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">照顾购买名称类型：</label>
                    <div class="layui-input-blockRight">
                        <select id="careBuyAreaNameTypeSelect" name="careBuyAreaNameType" class="layui-input">
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">物业减免类型：</label>
                    <div class="layui-input-blockRight">
                        <select id="propertyTypeSelect" name="propertyType" class="layui-input">
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">单据打印用项目名称：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="泉州台商投资区"
                               lay-verify="required" name="printTableName" value="${(zsProject.printTableName)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">安置小区名称：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="azProjectName"
                               value="${(zsProject.azProjectName)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">期房安置小区名称：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="azProjectNameForQf"
                               value="${(zsProject.azProjectNameForQf)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">选房中心地点：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="" name="chooseHousePlaceName"
                               value="${(zsProject.chooseHousePlaceName)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">选房中心电话：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="" name="chooseHousePlaceTel"
                               value="${(zsProject.chooseHousePlaceTel)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">缴款单位名称：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="takeMoneyUnitName"
                               value="${(zsProject.takeMoneyUnitName)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">开户行：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="bankName"
                               value="${(zsProject.bankName)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">银行账户：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                               lay-verify="required" name="bankAccount"
                               value="${(zsProject.bankAccount)!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">集中交房首日(即交房告知书上第一天交房时间)：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项" id="takeHouseDate"
                               name="takeHouseDate"
                               value="${(zsProject.takeHouseDate?string("yyyy-MM-dd"))!}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">项目登记日期：</label>
                    <div class="layui-input-blockRight">
                        <input type="text" class="layui-input" autocomplete="off" placeholder="必填项" id="startYear"
                               lay-verify="required" name="startYear"
                               value="${(zsProject.startYear?string("yyyy-MM-dd"))!}"/>
                    </div>
                </div>
            <#--<div class="layui-form-item">-->
            <#--<div class="layui-inline">-->
            <#--<label class="layui-form-labelLong">上午开始时间：</label>-->
            <#--<div class="layui-input-blockRight">-->
            <#--<input type="text" class="layui-input" autocomplete="off" style="width: 192px;"-->
            <#--id="morningTime" placeholder="必填项" lay-verify="required" name="morningTime"-->
            <#--value="${(zsProject.morningTime)!}"/>-->
            <#--</div>-->
            <#--</div>-->
            <#--<div class="layui-inline">-->
            <#--<label class="layui-form-labelLong">上午选房人数：</label>-->
            <#--<div class="layui-input-blockRight">-->
            <#--<input type="text" class="layui-input" autocomplete="off" style="width: 100px;"-->
            <#--placeholder="必填项" lay-verify="digitsRequired" name="morningCount"-->
            <#--value="${(zsProject.morningCount)!}"/>-->
            <#--</div>-->
            <#--</div>-->
            <#--</div>-->
            <#--<div class="layui-form-item">-->
            <#--<div class="layui-inline">-->
            <#--<label class="layui-form-labelLong">下午开始时间：</label>-->
            <#--<div class="layui-input-blockRight">-->
            <#--<input type="text" class="layui-input" autocomplete="off" style="width: 192px;"-->
            <#--id="afternoonTime" placeholder="必填项" lay-verify="required" name="afternoonTime"-->
            <#--value="${(zsProject.afternoonTime)!}"/>-->
            <#--</div>-->
            <#--</div>-->
            <#--<div class="layui-inline">-->
            <#--<label class="layui-form-labelLong">下午选房人数：</label>-->
            <#--<div class="layui-input-blockRight">-->
            <#--<input type="text" class="layui-input" autocomplete="off" style="width: 100px;"-->
            <#--placeholder="必填项" lay-verify="digitsRequired" name="afternoonCount"-->
            <#--value="${(zsProject.afternoonCount)!}"/>-->
            <#--</div>-->
            <#--</div>-->
            <#--</div>-->
                <div class="layui-form-item">
                    <label class="layui-form-labelLong">备注：</label>
                    <div class="layui-input-blockRight">
                        <textarea class="layui-textarea" cols="150" rows="5" name="memo">${(zsProject.memo)!}</textarea>
                    </div>
                </div>
                <button style="display: none;" class="layui-btn" id="submitBtn" name="submitBtn" lay-submit=""
                        lay-filter="submit">立即提交
                </button>
            </div>
        </div>
    </form>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['form', 'laydate', "verify", "dataDict"], function () {
        var form = layui.form, laydate = layui.laydate, $ = layui.jquery, verify = layui.verify, dataDict = layui.dataDict,
                parentIndex = parent.layer.getFrameIndex(window.name);

        dataDict.select("乡镇", "townSelect", "${(zsProject.town)!"01"}");
        dataDict.select("征收项目公示隐藏", "hideStatusSelect", "${(zsProject.hideStatus)!"01"}");
        dataDict.select("照顾购买名称类型", "careBuyAreaNameTypeSelect", "${(zsProject.careBuyAreaNameType)!1}");
        dataDict.select("物业减免类型", "propertyTypeSelect", "${(zsProject.propertyType)!1}");

        laydate.render({
            elem: '#takeHouseDate'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#startYear'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });
//        laydate.render({
//            elem: '#startYear'
//        });
//        laydate.render({
//            elem: '#morningTime'
//            , type: 'time'
//            , format: 'HH:mm'
//        });
//        laydate.render({
//            elem: '#afternoonTime'
//            , type: 'time'
//            , format: 'HH:mm'
//        });

        //监听提交
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: 'save',
                type: 'post',
                data: data.field,//当前容器的全部表单字段，名值对形式：{name: value}
                success: function (data) {
                    if (data.code == "0001") {
                        layer.alert(data.message);
                        parent.loadData();
                        parent.layer.close(parentIndex);
                    } else {
                        layer.msg(data.message, {anim: 6, icon: 2, time: 3000});
                    }
                }
            });
            return false;
        });

    });
</script>
</body>
</html>